/**
 * Copyright (c) 2010-2011 Pierre Labatut
 *
 * This file is part of Space-Chronicles project.
 *
 * Space-Chronicles is free software: you can redistribute it and/or modify it
 * under the terms of its license which may be found in the accompanying
 * LICENSE file or <http://code.google.com/p/space-chronicles/>.
 */
package space.app.meshview;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import space.app.common.Server;
import space.app.common.Application;
import space.stream.StructureInput;

/**
 *
 * @author Pierre
 */
public class MeshServer extends Server<MeshMessage> {

    public MeshServer(Application<MeshMessage> application) {
        super(application);
    }

    @Override
    public MeshMessage read(InputStream is) throws IOException {
        final String url = new StructureInput(is).readString();
        return new MeshMessage(new File(url).toURI().toURL());
    }
}
